Adjusting tabs

HTML

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<pre><code>// Default tab size
while (true) {
var d = new Date();
if (d.getDate()==1 &amp;&amp;
d.getMonth()==3) {
alert("TROLOLOL");
}
}</code></pre>

<pre><code>// tab-size: 2;
while (true) {
var d = new Date();
if (d.getDate()==1 &amp;&amp;
d.getMonth()==3) {
alert("TROLOLOL");
}
}</code></pre>

<pre><code>// tab-size: 4;
while (true) {
var d = new Date();
if (d.getDate()==1 &amp;&amp;
d.getMonth()==3) {
alert("TROLOLOL");
}
}</code></pre>

<pre><code>// tab-size: 0;
while (true) {
var d = new Date();
if (d.getDate()==1 &amp;&amp;
d.getMonth()==3) {
alert("TROLOLOL");
}
}</code></pre>

CSS

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/**
* Adjusting tabs
*/


pre {
padding: .5em;
line-height: 1.5;
background: hsl(20, 50%, 95%);
font-family: Consolas, Monaco, monospace;
}

pre:nth-of-type(2) { tab-size: 2 }
pre:nth-of-type(3) { tab-size: 4 }
pre:nth-of-type(4) { tab-size: 0 }

code {
font: inherit;
}